//
// Description: 50. Pow(x, n)
// Created by Loading on 2025/4/7.
//

#include <bits/stdc++.h>

using namespace std;

double myPow(double x, int n) {
    // 快速幂运算
    double res = 1;
    double base = x;
    // n可能为INT_MIN，要转换为8字节
    long long index = abs((long long)n);
    while (index) {
        if (index & 0x01) {
            res *= base;
        }
        base *= base;
        index >>= 1;
    }

    return n >=0 ? res : 1 / res;
}

int main() {
    double x = 1.000;
    int n = -2147483648;

    auto res = myPow(x, n);

    cout << res << endl;

    return 0;
}
